package com.liruirui.springboot_exam.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.liruirui.springboot_exam.entity.Movies;
import com.liruirui.springboot_exam.mapper.MoviesMapper;
import com.liruirui.springboot_exam.service.IMoviesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liruirui
 * @since 2022-02-09
 */
@Service
public class MoviesServiceImpl extends ServiceImpl<MoviesMapper, Movies> implements IMoviesService {

    @Override
    public PageInfo<Movies> getList(Movies movies, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return new PageInfo<Movies>(getBaseMapper().getList(movies));
    }

    @Override
    public Movies getByIdMovie(Integer id) {
        return getBaseMapper().getByIdMovie(id);
    }
}
